//
//  WYUserAccase.swift
//  weibo
//
//  Created by 王玉东 on 16/4/10.
//  Copyright © 2016年 wyd. All rights reserved.
//

import UIKit

class WYUserAccase: NSObject {
    var access_token: String?
    //access_token的生命周期，单位是秒数。
    //var expires_in: Int = 0
    //标识唯一用户的id
    var uid: String?
    //用户显示名称
    var name: String?
    //计算accesess_token的过期时间(以秒计算的)
    //10+当前时间
    var expires_in: NSTimeInterval = 0 {
    didSet {
        
         expires_date = NSDate(timeIntervalSinceNow: expires_in)
        
        }

    }
    
    
    
    //添加时间段 开发者帐号过期时间为5年
    var expires_date: NSDate?
    //图片
    var avatar_large: String?
    
    init(dic: [String : AnyObject]) {
        super.init()
        
        setValuesForKeysWithDictionary(dic)
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
    //MARK:将对象转化为字符串
    override  var description:String {
    let keys = ["access_token","avatar_large","name","uid","expires_in","expires_date"]
    let dict = self.dictionaryWithValuesForKeys(keys)
        return dict.description

    }

    //let keys

}
